<div bsModal #createOrEditModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="createOrEditModal"
    aria-hidden="true" [config]="{ backdrop: 'static' }" (onHidden)="onHidden($event)">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="d-flex align-items-center">
                <div class="mr-auto col-xs-6">
                    <h3 class="m-subheader__title m-subheader__title--separator"><span>规则选项</span></h3>
                </div>
                <div class="float-left" style="min-width: 240px;">
                    <label>关键字</label>
                    <input [(ngModel)]="filterText" style="width: 180px; display: inline-block; margin: 0 10px;" name="filterText"
                        autoFocus class="form-control m-input" [placeholder]="l('SearchWithThreeDot')" type="text" />
                </div>

                <div class="float-left mr-auto" style="min-width: 80px;">
                    <button (click)="getCodeRulesByFilter($event)" class="btn btn-primary blue" type="submit">
                        <i class="flaticon-search-1" [attr.aria-label]="l('Search')"> </i> 查询
                    </button>
                </div>

            </div>

            <div class="m-portlet m-portlet--mobile">
                <div class="m-portlet__body">
                    <form class="horizontal-form" autocomplete="off">
                        <div class="m-form m-form--label-align-right">
                            <div class="row align-items-center m--margin-bottom-10">
                                <div class="col-xl-12">
                                    <div class="form-group m-form__group align-items-center">
                                        <div class="input-group">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                    <div class="row align-items-center">
                        <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                            <p-table #dataTable (onLazyLoad)="getCodeRulesByFilter($event)" [value]="primengTableHelper.records"
                                [rows]="primengTableHelper.defaultRecordsCountPerPage" [paginator]="false" [lazy]="true"
                                [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                                dataKey="id" [resizableColumns]="primengTableHelper.resizableColumns" selectionMode="single"
                                [(selection)]="coderule" name="edd" (onRowSelect)="rowSelect(coderule)">
                                <ng-template pTemplate="header">
                                    <tr>
                                        <th style="width: 150px">
                                            规则编码
                                        </th>
                                        <th style="width: 150px">
                                            规则名称
                                        </th>
                                        <th style="width: 150px">
                                            规则类型
                                        </th>
                                        <th style="width: 150px">
                                            编码格式
                                        </th>
                                        <th style="width: 150px">
                                            最大长度
                                        </th>
                                        <th style="width: 150px">
                                            最小值
                                        </th>
                                        <th style="width: 150px">
                                            最大值
                                        </th>
                                        <th style="width: 150px">
                                            下一个流水号
                                        </th>
                                        <!-- <th style="width: 150px">
                                                            是否已停止使用
                                                        </th>
                                                        <th style="width: 150px">
                                                            是否使用中
                                                        </th> -->
                                    </tr>
                                </ng-template>
                                <ng-template pTemplate="body" let-record="$implicit">
                                    <tr [pSelectableRow]="record">
                                        <td width="150px">
                                            {{ record.f_RuleCode }}
                                        </td>
                                        <td width="150px">
                                            {{ record.f_RuleName }}
                                        </td>
                                        <td width="150px">
                                            {{ record.f_TypeName }}
                                        </td>
                                        <td width="150px">
                                            {{ record.f_Formate }}
                                        </td>
                                        <td width="150px">
                                            {{ record.f_Length }}
                                        </td>
                                        <td width="150px">
                                            {{ record.f_MinValue }}
                                        </td>
                                        <td width="150px">
                                            {{ record.f_MaxValue }}
                                        </td>
                                        <td width="150px">
                                            {{ record.f_NextCode }}
                                        </td>
                                        <!-- <td width="150px">
                                                            {{ record.f_Blocked }}
                                                        </td>
                                                        <td width="150px">
                                                            {{ record.f_IsUsing }}
                                                        </td> -->
                                    </tr>
                                </ng-template>
                            </p-table>
                            <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                                {{ l('NoData') }}
                            </div>
                            <div class="primeng-paging-container">
                                <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                                    (onPageChange)="getCodeRulesByFilter($event)" [totalRecords]="primengTableHelper.totalRecordsCount"
                                    [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
                                </p-paginator>
                                <span class="total-records-count">
                                    {{ l('TotalRecordsCount', primengTableHelper.totalRecordsCount) }}
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>

</div>